/*      */ package com.zimbra.qa.unittest;
/*      */ 
/*      */ import com.zimbra.common.account.Key.AccountBy;
/*      */ import com.zimbra.common.account.Key.DomainBy;
/*      */ import com.zimbra.common.auth.ZAuthToken;
/*      */ import com.zimbra.common.lmtp.LmtpProtocolException;
/*      */ import com.zimbra.common.service.ServiceException;
/*      */ import com.zimbra.common.soap.AccountConstants;
/*      */ import com.zimbra.common.soap.AdminConstants;
/*      */ import com.zimbra.common.soap.Element;
/*      */ import com.zimbra.common.soap.Element.XMLElement;
/*      */ import com.zimbra.common.util.CliUtil;
/*      */ import com.zimbra.common.util.DateUtil;
/*      */ import com.zimbra.cs.account.Account;
/*      */ import com.zimbra.cs.account.Domain;
/*      */ import com.zimbra.cs.account.Provisioning;
/*      */ import com.zimbra.cs.account.Signature;
/*      */ import com.zimbra.cs.account.auth.AuthContext.Protocol;
/*      */ import com.zimbra.cs.account.soap.SoapProvisioning;
/*      */ import com.zimbra.cs.account.soap.SoapProvisioning.DelegateAuthResponse;
/*      */ import java.io.PrintStream;
/*      */ import java.lang.reflect.InvocationTargetException;
/*      */ import java.lang.reflect.Method;
/*      */ import java.util.Date;
/*      */ import java.util.HashMap;
/*      */ import java.util.Map;
/*      */ import org.junit.Assert;
/*      */ import org.junit.Before;
/*      */ import org.junit.BeforeClass;
/*      */ import org.junit.Test;
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ public class TestProvDomainStatus
/*      */ {
/*      */   private Provisioning mProv;
/*      */   private SoapProvisioning mSoapProv;
/*      */   private SoapProvisioning mSoapProvAdmin;
/*      */   private String TEST_ID;
/*   58 */   private static String TEST_CLASS_NAME = "test-domainstatus";
/*      */   
/*   60 */   private static String PASSWORD = "test123";
/*   61 */   private static String NAMEPREFIX_ACCOUNT = "acct-";
/*      */   
/*      */   private String DOMAIN_NAME;
/*   64 */   private static final String NAME_PREFIX = TestLmtp.class.getSimpleName();
/*      */   private Account[] mAccts;
/*      */   private static HashMap<String, Map<String, String>> sStatusMap;
/*      */   
/*      */   @BeforeClass
/*      */   public static void init() throws Exception
/*      */   {
/*   71 */     CliUtil.toolSetup();
/*      */     
/*   73 */     sStatusMap = new HashMap();
/*      */     
/*   75 */     Map<String, String> domainActive = new HashMap();
/*   76 */     domainActive.put("active", "active");
/*   77 */     domainActive.put("lockout", "lockout");
/*   78 */     domainActive.put("locked", "locked");
/*   79 */     domainActive.put("maintenance", "maintenance");
/*   80 */     domainActive.put("closed", "closed");
/*      */     
/*   82 */     Map<String, String> domainLocked = new HashMap();
/*   83 */     domainLocked.put("active", "locked");
/*   84 */     domainLocked.put("lockout", "locked");
/*   85 */     domainLocked.put("locked", "locked");
/*   86 */     domainLocked.put("maintenance", "maintenance");
/*   87 */     domainLocked.put("closed", "closed");
/*      */     
/*   89 */     Map<String, String> domainMaintenance = new HashMap();
/*   90 */     domainMaintenance.put("active", "maintenance");
/*   91 */     domainMaintenance.put("lockout", "maintenance");
/*   92 */     domainMaintenance.put("locked", "maintenance");
/*   93 */     domainMaintenance.put("maintenance", "maintenance");
/*   94 */     domainMaintenance.put("closed", "closed");
/*      */     
/*   96 */     Map<String, String> domainSuspended = new HashMap();
/*   97 */     domainSuspended.put("active", "maintenance");
/*   98 */     domainSuspended.put("lockout", "maintenance");
/*   99 */     domainSuspended.put("locked", "maintenance");
/*  100 */     domainSuspended.put("maintenance", "maintenance");
/*  101 */     domainSuspended.put("closed", "closed");
/*      */     
/*  103 */     Map<String, String> domainClosed = new HashMap();
/*  104 */     domainClosed.put("active", "closed");
/*  105 */     domainClosed.put("lockout", "closed");
/*  106 */     domainClosed.put("locked", "closed");
/*  107 */     domainClosed.put("maintenance", "closed");
/*  108 */     domainClosed.put("closed", "closed");
/*      */     
/*  110 */     sStatusMap.put("active", domainActive);
/*  111 */     sStatusMap.put("locked", domainLocked);
/*  112 */     sStatusMap.put("maintenance", domainMaintenance);
/*  113 */     sStatusMap.put("suspended", domainSuspended);
/*  114 */     sStatusMap.put("closed", domainClosed);
/*      */   }
/*      */   
/*      */ 
/*      */   private static enum DomainStatus
/*      */   {
/*  120 */     EMPTY, 
/*  121 */     active, 
/*  122 */     locked, 
/*  123 */     maintenance, 
/*  124 */     suspended, 
/*  125 */     closed;
/*      */     
/*      */     private DomainStatus() {}
/*      */   }
/*      */   
/*  130 */   private static enum AccountStatus { active, 
/*  131 */     lockout, 
/*  132 */     locked, 
/*  133 */     maintenance, 
/*  134 */     closed;
/*      */     
/*      */     private AccountStatus() {} }
/*      */   
/*  138 */   private static enum AccountType { ACCT_USER, 
/*  139 */     ACCT_DOMAIN_ADMIN, 
/*  140 */     ACCT_GLOBAL_ADMIN;
/*      */     
/*      */     private AccountType() {}
/*      */   }
/*      */   
/*      */   @Before
/*  146 */   public void setUp() throws Exception { this.TEST_ID = TestProvisioningUtil.genTestId();
/*      */     
/*  148 */     System.out.println("\nTest " + this.TEST_ID + " setting up...\n");
/*      */     
/*  150 */     this.mSoapProv = new SoapProvisioning();
/*  151 */     this.mSoapProv.soapSetURI(TestUtil.getSoapUrl());
/*      */     
/*      */ 
/*  154 */     this.mSoapProvAdmin = new SoapProvisioning();
/*  155 */     this.mSoapProvAdmin.soapSetURI(TestUtil.getAdminSoapUrl());
/*      */     
/*      */ 
/*  158 */     this.mSoapProvAdmin.soapZimbraAdminAuthenticate();
/*      */     
/*  160 */     this.mProv = this.mSoapProvAdmin;
/*      */     
/*      */ 
/*  163 */     this.DOMAIN_NAME = TestProvisioningUtil.baseDomainName(TEST_CLASS_NAME, this.TEST_ID);
/*      */     
/*  165 */     createDomain(this.DOMAIN_NAME);
/*  166 */     this.mAccts = new Account[AccountStatus.values().length];
/*      */     
/*  168 */     for (AccountStatus as : AccountStatus.values()) {
/*  169 */       Account acct = createAccount(ACCOUNT_NAME(as), AccountType.ACCT_USER);
/*  170 */       this.mAccts[as.ordinal()] = acct;
/*  171 */       this.mProv.modifyAccountStatus(acct, as.name());
/*  172 */       if (as == AccountStatus.lockout)
/*  173 */         lockoutAccount(acct, true);
/*      */     }
/*      */   }
/*      */   
/*      */   private String ACCOUNT_NAME(AccountStatus as) {
/*  178 */     String localPart = NAMEPREFIX_ACCOUNT + as.name();
/*  179 */     return ACCOUNT_NAME(localPart);
/*      */   }
/*      */   
/*      */   private String ACCOUNT_NAME(String localPart) {
/*  183 */     return localPart + "@" + this.DOMAIN_NAME;
/*      */   }
/*      */   
/*      */   private void createDomain(String domainName) throws Exception {
/*  187 */     Map<String, Object> attrs = new HashMap();
/*  188 */     Domain domain = this.mProv.createDomain(domainName, attrs);
/*  189 */     Assert.assertNotNull(domain);
/*      */   }
/*      */   
/*      */   private Account createAccount(String accountEmail, AccountType at) throws Exception {
/*  193 */     Map<String, Object> acctAttrs = new HashMap();
/*      */     
/*  195 */     if (at == AccountType.ACCT_DOMAIN_ADMIN) {
/*  196 */       acctAttrs.put("zimbraIsDomainAdminAccount", "TRUE");
/*  197 */     } else if (at == AccountType.ACCT_GLOBAL_ADMIN) {
/*  198 */       acctAttrs.put("zimbraIsAdminAccount", "TRUE");
/*      */     }
/*  200 */     Account acct = this.mProv.createAccount(accountEmail, PASSWORD, acctAttrs);
/*  201 */     Assert.assertNotNull(acct);
/*  202 */     return acct;
/*      */   }
/*      */   
/*      */   private Domain getDomain() throws Exception {
/*  206 */     Domain domain = this.mProv.get(Key.DomainBy.name, this.DOMAIN_NAME);
/*  207 */     Assert.assertNotNull(domain);
/*  208 */     return domain;
/*      */   }
/*      */   
/*      */ 
/*      */ 
/*      */ 
/*      */   private Account getAccount(AccountStatus as)
/*      */     throws Exception
/*      */   {
/*  217 */     return this.mAccts[as.ordinal()];
/*      */   }
/*      */   
/*      */   private String expectedAccountStatus(String domainStatus, String acctStatus) throws Exception {
/*  221 */     return (String)((Map)sStatusMap.get(domainStatus)).get(acctStatus);
/*      */   }
/*      */   
/*      */   private void lockoutAccount(Account acct, boolean set) throws Exception {
/*  225 */     Map<String, Object> attrs = new HashMap();
/*  226 */     if (set) {
/*  227 */       attrs.put("zimbraPasswordLockoutMaxFailures", "1");
/*  228 */       attrs.put("zimbraPasswordLockoutEnabled", "TRUE");
/*  229 */       attrs.put("zimbraPasswordLockoutLockedTime", DateUtil.toGeneralizedTime(new Date()));
/*  230 */       this.mProv.modifyAttrs(acct, attrs);
/*      */     } else {
/*  232 */       attrs.put("zimbraPasswordLockoutMaxFailures", "");
/*  233 */       attrs.put("-zimbraPasswordLockoutEnabled", "TRUE");
/*  234 */       attrs.put("zimbraPasswordLockoutLockedTime", "");
/*  235 */       this.mProv.modifyAttrs(acct, attrs);
/*      */     }
/*      */   }
/*      */   
/*      */   private void authTest(Account acct, String status)
/*      */   {
/*  241 */     boolean ok = false;
/*      */     
/*      */     try
/*      */     {
/*  245 */       this.mProv.authAccount(acct, PASSWORD, AuthContext.Protocol.test);
/*      */       
/*  247 */       if (status.equals("active")) {
/*  248 */         ok = true;
/*      */       }
/*      */     } catch (ServiceException e) {
/*  251 */       if (status.equals("active")) {
/*  252 */         Assert.fail();
/*  253 */       } else if (status.equals("locked")) {
/*  254 */         if (e.getCode().equals("account.AUTH_FAILED"))
/*  255 */           ok = true;
/*  256 */       } else if (status.equals("lockout")) {
/*  257 */         if (e.getCode().equals("account.AUTH_FAILED"))
/*  258 */           ok = true;
/*  259 */       } else if (status.equals("maintenance")) {
/*  260 */         if (e.getCode().equals("account.MAINTENANCE_MODE"))
/*  261 */           ok = true;
/*  262 */       } else if ((status.equals("closed")) && 
/*  263 */         (e.getCode().equals("account.AUTH_FAILED"))) {
/*  264 */         ok = true;
/*      */       }
/*      */     }
/*  267 */     Assert.assertTrue(ok);
/*      */   }
/*      */   
/*      */   private void mailTest(Account acct, String status) throws Exception
/*      */   {
/*  272 */     boolean ok = false;
/*      */     try
/*      */     {
/*  275 */       TestUtil.addMessageLmtp(NAME_PREFIX + " 1", acct.getName(), "phoebeshao");
/*      */       
/*  277 */       if ((status.equals("active")) || (status.equals("lockout")) || (status.equals("locked")))
/*      */       {
/*      */ 
/*  280 */         ok = true; }
/*      */     } catch (LmtpProtocolException e) {
/*  282 */       if ((status.equals("active")) || (status.equals("lockout")) || (status.equals("locked")))
/*      */       {
/*      */ 
/*  285 */         Assert.fail();
/*  286 */       } else if ((status.equals("maintenance")) || (status.equals("closed")))
/*      */       {
/*  288 */         if (e.getMessage().equals("503 5.5.1 No recipients"))
/*  289 */           ok = true;
/*      */       }
/*      */     }
/*  292 */     Assert.assertTrue(ok);
/*      */   }
/*      */   
/*      */   private void statusTest(Account acct, String domainStatus, String acctStatus) throws Exception {
/*  296 */     String status = expectedAccountStatus(domainStatus, acctStatus);
/*  297 */     System.out.println(domainStatus + " " + acctStatus + " => " + status);
/*      */     
/*  299 */     authTest(acct, status);
/*  300 */     mailTest(acct, status);
/*      */   }
/*      */   
/*      */   private void statusTest(String domainStatus) throws Exception {
/*  304 */     for (AccountStatus as : ) {
/*  305 */       Account acct = getAccount(as);
/*  306 */       statusTest(acct, domainStatus, as.name());
/*      */     }
/*      */   }
/*      */   
/*      */   private void assertCodeEquals(ServiceException e, String expectedCode) {
/*  311 */     Assert.assertEquals(e.getCode(), expectedCode);
/*      */   }
/*      */   
/*      */   private void statusTest() throws Exception
/*      */   {
/*  316 */     Domain domain = getDomain();
/*      */     
/*  318 */     for (DomainStatus ds : DomainStatus.values()) {
/*  319 */       String domainStatus = ds.name();
/*  320 */       if (ds == DomainStatus.EMPTY) {
/*  321 */         Map attrs = new HashMap();
/*  322 */         attrs.put("zimbraDomainStatus", "");
/*  323 */         this.mProv.modifyAttrs(domain, attrs);
/*  324 */         domainStatus = DomainStatus.active.name();
/*      */       } else {
/*  326 */         Map attrs = new HashMap();
/*  327 */         attrs.put("zimbraDomainStatus", domainStatus);
/*  328 */         this.mProv.modifyAttrs(domain, attrs);
/*      */       }
/*      */       
/*  331 */       statusTest(domainStatus);
/*      */     }
/*      */   }
/*      */   
/*      */ 
/*      */   static class SoapTestContext
/*      */   {
/*      */     private TestProvDomainStatus.SoapClient mSoapClient;
/*      */     private TestProvDomainStatus.AccountType mAuthedAcctType;
/*      */     private Account mTargetAcct;
/*      */     private boolean mSuspended;
/*      */     private String mDomainName;
/*      */     private String mDomainId;
/*      */     private String[] mTesters;
/*      */     private String mTestId;
/*      */     
/*      */     SoapTestContext(TestProvDomainStatus.SoapClient soapClient, TestProvDomainStatus.AccountType authedAcctType, Account targetAcct, boolean suspended, String domainName, String domainId, String[] testers, String testId)
/*      */     {
/*  349 */       this.mSoapClient = soapClient;
/*  350 */       this.mAuthedAcctType = authedAcctType;
/*  351 */       this.mTargetAcct = targetAcct;
/*  352 */       this.mSuspended = suspended;
/*  353 */       this.mDomainName = domainName;
/*  354 */       this.mDomainId = domainId;
/*  355 */       this.mTesters = testers;
/*  356 */       this.mTestId = testId;
/*      */     }
/*      */   }
/*      */   
/*      */   static class SoapCommands {
/*      */     private TestProvDomainStatus.SoapTestContext mCtx;
/*      */     private Map<String, String> mSignatureNameIdMap;
/*      */     
/*      */     public static enum TesterObjs {
/*  365 */       TESTER_ID_ACCOUNT_FOR_DELETE_ACCOUNT_REQUEST;
/*      */       
/*      */ 
/*      */       private TesterObjs() {}
/*      */     }
/*      */     
/*      */     SoapCommands(TestProvDomainStatus.SoapTestContext ctx)
/*      */     {
/*  373 */       this.mCtx = ctx;
/*      */       
/*  375 */       this.mSignatureNameIdMap = new HashMap();
/*      */     }
/*      */     
/*      */     private String testCtxId() {
/*  379 */       return TestProvDomainStatus.SoapTestContext.access$000(this.mCtx).name() + "-" + (TestProvDomainStatus.SoapTestContext.access$100(this.mCtx) ? "suspended" : "active");
/*      */     }
/*      */     
/*      */     private String identityName() {
/*  383 */       return "identity-of-" + testCtxId();
/*      */     }
/*      */     
/*      */     private String signatureName() {
/*  387 */       return "signature-of-" + testCtxId();
/*      */     }
/*      */     
/*      */     private String accountName() {
/*  391 */       return "acct-created-by-" + testCtxId() + "@" + TestProvDomainStatus.SoapTestContext.access$200(this.mCtx);
/*      */     }
/*      */     
/*      */     private String aliasName() {
/*  395 */       return "alias-created-by-" + testCtxId() + "@" + TestProvDomainStatus.SoapTestContext.access$200(this.mCtx);
/*      */     }
/*      */     
/*      */     private String domainName() {
/*  399 */       return "domain-created-by-" + testCtxId() + "." + TestProvDomainStatus.SoapTestContext.access$200(this.mCtx);
/*      */     }
/*      */     
/*      */     private String cosName() {
/*  403 */       String cosName = "cos-created-by-" + testCtxId() + "-" + TestProvDomainStatus.SoapTestContext.access$300(this.mCtx);
/*  404 */       return cosName.replace("_", "-");
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */     public void AUTH_REQUEST()
/*      */       throws Exception
/*      */     {
/*  413 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).authAccount(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), TestProvDomainStatus.PASSWORD, AuthContext.Protocol.test);
/*      */     }
/*      */     
/*      */     public void CHANGE_PASSWORD_REQUEST() throws Exception {
/*  417 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).changePassword(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), TestProvDomainStatus.PASSWORD, TestProvDomainStatus.PASSWORD);
/*      */     }
/*      */     
/*      */     public void GET_PREFS_REQUEST() throws Exception {
/*  421 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.GET_PREFS_REQUEST);
/*  422 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void MODIFY_PREFS_REQUEST() throws Exception {
/*  426 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.MODIFY_PREFS_REQUEST);
/*  427 */       Element p = req.addElement("pref");
/*  428 */       p.addAttribute("name", "zimbraPrefSkin");
/*  429 */       p.setText("sand");
/*  430 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void GET_INFO_REQUEST() throws Exception {
/*  434 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.GET_INFO_REQUEST);
/*  435 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void GET_ACCOUNT_INFO_REQUEST() throws Exception {
/*  439 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.GET_ACCOUNT_INFO_REQUEST);
/*  440 */       Element a = req.addElement("account");
/*  441 */       a.addAttribute("by", "name");
/*  442 */       a.setText(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getName());
/*  443 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invokeOnTargetAccount(req, TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getId());
/*      */     }
/*      */     
/*      */     public void SEARCH_GAL_REQUEST() throws Exception {
/*  447 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.SEARCH_GAL_REQUEST);
/*  448 */       Element n = req.addElement("name");
/*  449 */       n.setText("foo");
/*  450 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void AUTO_COMPLETE_GAL_REQUEST() throws Exception {
/*  454 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.AUTO_COMPLETE_GAL_REQUEST);
/*  455 */       req.addAttribute("limit", "20");
/*  456 */       Element n = req.addElement("name");
/*  457 */       n.setText("foo");
/*  458 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void SYNC_GAL_REQUEST() throws Exception {
/*  462 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.SYNC_GAL_REQUEST);
/*  463 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void SEARCH_CALENDAR_RESOURCES_REQUEST() throws Exception {
/*  467 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.SEARCH_CALENDAR_RESOURCES_REQUEST);
/*  468 */       Element sf = req.addElement("searchFilter");
/*  469 */       Element cond = sf.addElement("cond");
/*  470 */       cond.addAttribute("attr", "zimbraCalResType");
/*  471 */       cond.addAttribute("op", "eq");
/*  472 */       cond.addAttribute("value", "Equipment");
/*  473 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void MODIFY_PROPERTIES_REQUEST() throws Exception {
/*  477 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.MODIFY_PROPERTIES_REQUEST);
/*  478 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void GET_ALL_LOCALES_REQUEST() throws Exception {
/*  482 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.GET_ALL_LOCALES_REQUEST);
/*  483 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void GET_AVAILABLE_LOCALES_REQUEST() throws Exception {
/*  487 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.GET_AVAILABLE_LOCALES_REQUEST);
/*  488 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void GET_AVAILABLE_SKINS_REQUEST() throws Exception {
/*  492 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.GET_AVAILABLE_SKINS_REQUEST);
/*  493 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void CREATE_IDENTITY_REQUEST() throws Exception {
/*  497 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).createIdentity(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), identityName(), new HashMap());
/*      */     }
/*      */     
/*      */     public void MODIFY_IDENTITY_REQUEST() throws Exception {
/*  501 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).modifyIdentity(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), identityName(), new HashMap());
/*      */     }
/*      */     
/*      */     public void DELETE_IDENTITY_REQUEST() throws Exception {
/*  505 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).deleteIdentity(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), identityName());
/*      */     }
/*      */     
/*      */     public void GET_IDENTITIES_REQUEST() throws Exception {
/*  509 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).getAllIdentities(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx));
/*      */     }
/*      */     
/*      */     public void CREATE_SIGNATURE_REQUEST() throws Exception {
/*  513 */       Signature sig = TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).createSignature(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), signatureName(), new HashMap());
/*  514 */       this.mSignatureNameIdMap.put(sig.getName(), sig.getId());
/*      */     }
/*      */     
/*      */     public void MODIFY_SIGNATURE_REQUEST() throws Exception {
/*  518 */       String sigId = (String)this.mSignatureNameIdMap.get(signatureName());
/*  519 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).modifySignature(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), sigId, new HashMap());
/*      */     }
/*      */     
/*      */     public void DELETE_SIGNATURE_REQUEST() throws Exception {
/*  523 */       String sigId = (String)this.mSignatureNameIdMap.get(signatureName());
/*  524 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).deleteSignature(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), sigId);
/*      */     }
/*      */     
/*      */     public void GET_SIGNATURES_REQUEST() throws Exception {
/*  528 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).getAllSignatures(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx));
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */     public void PING_REQUEST()
/*      */       throws Exception
/*      */     {
/*  537 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.PING_REQUEST);
/*  538 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void CHECK_HEALTH_REQUEST() throws Exception {
/*  542 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).healthCheck();
/*      */     }
/*      */     
/*      */     public void ADMIN_AUTH_REQUEST() throws Exception {
/*  546 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.AUTH_REQUEST);
/*  547 */       req.addElement("name").setText(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getName());
/*  548 */       req.addElement("password").setText(TestProvDomainStatus.PASSWORD);
/*  549 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void CREATE_ACCOUNT_REQUEST() throws Exception {
/*  553 */       Account acct = TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).createAccount(accountName(), TestProvDomainStatus.PASSWORD, null);
/*      */     }
/*      */     
/*      */     public void DELEGATE_AUTH_REQUEST() throws Exception {
/*  557 */       SoapProvisioning.DelegateAuthResponse r = TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).delegateAuth(Key.AccountBy.name, TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getName(), 0);
/*      */     }
/*      */     
/*      */     public void GET_ACCOUNT_REQUEST() throws Exception {
/*  561 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.GET_ACCOUNT_REQUEST);
/*  562 */       Element a = req.addElement("account");
/*  563 */       a.addAttribute("by", "name");
/*  564 */       a.setText(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getName());
/*  565 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invokeOnTargetAccount(req, TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getId());
/*      */     }
/*      */     
/*      */     public void ADMIN_GET_ACCOUNT_INFO_REQUEST() throws Exception {
/*  569 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).getAccountInfo(Key.AccountBy.name, TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getName());
/*      */     }
/*      */     
/*      */     public void GET_ALL_ACCOUNTS_REQUEST() throws Exception
/*      */     {
/*  574 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.GET_ALL_ACCOUNTS_REQUEST);
/*  575 */       Element eDomain = req.addElement("domain");
/*  576 */       eDomain.addAttribute("by", Key.DomainBy.name.name());
/*  577 */       eDomain.setText(TestProvDomainStatus.SoapTestContext.access$200(this.mCtx));
/*  578 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void KNOWNBUG_GET_ALL_ACCOUNTS_REQUEST() throws Exception
/*      */     {
/*  583 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.GET_ALL_ACCOUNTS_REQUEST);
/*  584 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void GET_ALL_ADMIN_ACCOUNTS_REQUEST() throws Exception {
/*  588 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).getAllAdminAccounts();
/*      */     }
/*      */     
/*      */     public void MODIFY_ACCOUNT_REQUEST() throws Exception {
/*  592 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.MODIFY_ACCOUNT_REQUEST);
/*  593 */       Element eId = req.addElement("id");
/*  594 */       eId.setText(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx).getId());
/*  595 */       Element eA = req.addElement("a");
/*  596 */       eA.addAttribute("n", "zimbraAttachmentsBlocked");
/*  597 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */     public void DELETE_ACCOUNT_REQUEST() throws Exception {
/*  601 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).deleteAccount(TestProvDomainStatus.SoapTestContext.access$700(this.mCtx)[TesterObjs.TESTER_ID_ACCOUNT_FOR_DELETE_ACCOUNT_REQUEST.ordinal()]);
/*      */     }
/*      */     
/*      */     public void SET_PASSWORD_REQUEST() throws Exception {
/*  605 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).setPassword(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), TestProvDomainStatus.PASSWORD);
/*      */     }
/*      */     
/*      */     public void CHECK_PASSWORD_STRENGTH_REQUEST() throws Exception {
/*  609 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).checkPasswordStrength(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), TestProvDomainStatus.PASSWORD);
/*      */     }
/*      */     
/*      */     public void ADD_ACCOUNT_ALIAS_REQUEST() throws Exception {
/*  613 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).addAlias(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), aliasName());
/*      */     }
/*      */     
/*      */     public void REMOVE_ACCOUNT_ALIAS_REQUEST() throws Exception {
/*  617 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).removeAlias(TestProvDomainStatus.SoapTestContext.access$400(this.mCtx), aliasName());
/*      */     }
/*      */     
/*      */     public void CREATE_DOMAIN_REQUEST()
/*      */       throws Exception
/*      */     {
/*  623 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).createDomain(domainName(), null);
/*      */     }
/*      */     
/*      */     public void GET_DOMAIN_REQUEST() throws Exception {
/*  627 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).get(Key.DomainBy.name, TestProvDomainStatus.SoapTestContext.access$200(this.mCtx));
/*      */     }
/*      */     
/*      */     public void GET_DOMAIN_INFO_REQUEST() throws Exception
/*      */     {
/*  632 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).getDomainInfo(Key.DomainBy.name, TestProvDomainStatus.SoapTestContext.access$200(this.mCtx));
/*      */     }
/*      */     
/*      */     public void GET_ALL_DOMAINS_REQUEST() throws Exception {
/*  636 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).getAllDomains();
/*      */     }
/*      */     
/*      */     public void MODIFY_DOMAIN_REQUEST() throws Exception {
/*  640 */       Element.XMLElement req = new Element.XMLElement(AdminConstants.MODIFY_DOMAIN_REQUEST);
/*  641 */       Element eId = req.addElement("id");
/*  642 */       eId.setText(TestProvDomainStatus.SoapTestContext.access$800(this.mCtx));
/*  643 */       Element eA = req.addElement("a");
/*  644 */       eA.addAttribute("n", "description").addText("this is a domain");
/*  645 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).invoke(req);
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */     public void DELETE_DOMAIN_REQUEST()
/*      */       throws Exception
/*      */     {
/*  674 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).deleteDomain(TestProvDomainStatus.SoapTestContext.access$800(this.mCtx));
/*      */     }
/*      */     
/*      */     public void CREATE_COS_REQUEST()
/*      */       throws Exception
/*      */     {
/*  680 */       TestProvDomainStatus.SoapTestContext.access$600(this.mCtx).createCos(cosName(), null);
/*      */     }
/*      */     
/*      */     private static enum Result
/*      */     {
/*  685 */       GOOD("G_O_O_D", "G_O_O_D"), 
/*  686 */       BAD("B_A_D", "B_A_D"), 
/*      */       
/*  688 */       KNOWN_BUG("KNOWN_BUG", "KNOWN_BUG"), 
/*  689 */       ACCOUNT_INACTIVE("account.ACCOUNT_INACTIVE", "account is not active"), 
/*  690 */       AUTH_EXPIRED("service.AUTH_EXPIRED", "auth credentials have expired"), 
/*  691 */       DOMAIN_NOT_EMPTY("account.DOMAIN_NOT_EMPTY", "domain not empty"), 
/*  692 */       MAINTENANCE_MODE("account.MAINTENANCE_MODE", "account is in maintenance mode"), 
/*  693 */       PERM_DENIED_1("service.PERM_DENIED", "permission denied: not an admin account"), 
/*  694 */       PERM_DENIED_2("service.PERM_DENIED", "permission denied: need admin token"), 
/*  695 */       PERM_DENIED_3("service.PERM_DENIED", "permission denied: domain is suspended");
/*      */       
/*      */       String mCode;
/*      */       String mMsg;
/*      */       
/*      */       private static class R {
/*  701 */         static Map<String, TestProvDomainStatus.SoapCommands.Result> sMap = new HashMap();
/*      */         
/*  703 */         static String getKey(String code, String msg) { return "[" + code + "]" + " - " + msg; }
/*      */       }
/*      */       
/*      */       private Result(String code, String msg)
/*      */       {
/*  708 */         this.mCode = code;
/*  709 */         this.mMsg = msg;
/*      */         
/*  711 */         R.sMap.put(R.getKey(this.mCode, this.mMsg), this);
/*      */       }
/*      */       
/*      */       static Result toResult(ServiceException e) {
/*  715 */         String code = e.getCode();
/*  716 */         String msg = e.getMessage();
/*      */         
/*  718 */         Assert.assertNotNull(code);
/*  719 */         Assert.assertNotNull(msg);
/*      */         
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*  727 */         String key = R.getKey(code, msg);
/*  728 */         for (String k : R.sMap.keySet()) {
/*  729 */           if (key.startsWith(k))
/*  730 */             return (Result)R.sMap.get(k);
/*      */         }
/*  732 */         Assert.fail("unknow exception " + key);
/*  733 */         return null;
/*      */       }
/*      */     }
/*      */     
/*      */     private static enum Command {
/*  738 */       ACCOUNT_FIRST_COMMAND, 
/*  739 */       ACCOUNT_AUTH_REQUEST("AUTH_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE), 
/*  740 */       ACCOUNT_CHANGE_PASSWORD_REQUEST("CHANGE_PASSWORD_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE), 
/*  741 */       ACCOUNT_GET_PREFS_REQUEST("GET_PREFS_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  742 */       ACCOUNT_MODIFY_PREFS_REQUEST("MODIFY_PREFS_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  743 */       ACCOUNT_GET_INFO_REQUEST("GET_INFO_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  744 */       ACCOUNT_GET_ACCOUNT_INFO_REQUEST("GET_ACCOUNT_INFO_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  745 */       ACCOUNT_SEARCH_GAL_REQUEST("SEARCH_GAL_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  746 */       ACCOUNT_AUTO_COMPLETE_GAL_REQUEST("AUTO_COMPLETE_GAL_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  747 */       ACCOUNT_SYNC_GAL_REQUEST("SYNC_GAL_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  748 */       ACCOUNT_SEARCH_CALENDAR_RESOURCES_REQUEST("SEARCH_CALENDAR_RESOURCES_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  749 */       ACCOUNT_MODIFY_PROPERTIES_REQUEST("MODIFY_PROPERTIES_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  750 */       ACCOUNT_GET_ALL_LOCALES_REQUEST("GET_ALL_LOCALES_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  751 */       ACCOUNT_GET_AVAILABLE_LOCALES_REQUEST("GET_AVAILABLE_LOCALES_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  752 */       ACCOUNT_GET_AVAILABLE_SKINS_REQUEST("GET_AVAILABLE_SKINS_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  753 */       ACCOUNT_CREATE_IDENTITY_REQUEST("CREATE_IDENTITY_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  754 */       ACCOUNT_MODIFY_IDENTITY_REQUEST("MODIFY_IDENTITY_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  755 */       ACCOUNT_DELETE_IDENTITY_REQUEST("DELETE_IDENTITY_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  756 */       ACCOUNT_GET_IDENTITIES_REQUEST("GET_IDENTITIES_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  757 */       ACCOUNT_CREATE_SIGNATURE_REQUEST("CREATE_SIGNATURE_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  758 */       ACCOUNT_MODIFY_SIGNATURE_REQUEST("MODIFY_SIGNATURE_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  759 */       ACCOUNT_DELETE_SIGNATURE_REQUEST("DELETE_SIGNATURE_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  760 */       ACCOUNT_GET_SIGNATURES_REQUEST("GET_SIGNATURES_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.ACCOUNT_INACTIVE), 
/*  761 */       ACCOUNT_LAST_COMMAND, 
/*      */       
/*      */ 
/*  764 */       ADMIN_FIRST_COMMAND, 
/*  765 */       ADMIN_PING_REQUEST("PING_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  766 */       ADMIN_CHECK_HEALTH_REQUEST("CHECK_HEALTH_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*      */       
/*  768 */       ADMIN_AUTH_REQUEST("ADMIN_AUTH_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_1, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_1, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_1, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE, TestProvDomainStatus.SoapCommands.Result.MAINTENANCE_MODE), 
/*  769 */       ADMIN_CREATE_ACCOUNT_REQUEST("CREATE_ACCOUNT_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  770 */       ADMIN_DELEGATE_AUTH_REQUEST("DELEGATE_AUTH_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  771 */       ADMIN_GET_ACCOUNT_REQUEST("GET_ACCOUNT_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  772 */       ADMIN_GET_ACCOUNT_INFO_REQUEST("ADMIN_GET_ACCOUNT_INFO_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  773 */       ADMIN_GET_ALL_ACCOUNTS_REQUEST("GET_ALL_ACCOUNTS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  774 */       ADMIN_KNOWNBUG_GET_ALL_ACCOUNTS_REQUEST("KNOWNBUG_GET_ALL_ACCOUNTS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.KNOWN_BUG), 
/*  775 */       ADMIN_GET_ALL_ADMIN_ACCOUNTS_REQUEST("GET_ALL_ADMIN_ACCOUNTS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  776 */       ADMIN_MODIFY_ACCOUNT_REQUEST("MODIFY_ACCOUNT_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  777 */       ADMIN_DELETE_ACCOUNT_REQUEST("DELETE_ACCOUNT_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  778 */       ADMIN_SET_PASSWORD_REQUEST("SET_PASSWORD_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  779 */       ADMIN_CHECK_PASSWORD_STRENGTH_REQUEST("CHECK_PASSWORD_STRENGTH_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  780 */       ADMIN_ADD_ACCOUNT_ALIAS_REQUEST("ADD_ACCOUNT_ALIAS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*  781 */       ADMIN_REMOVE_ACCOUNT_ALIAS_REQUEST("REMOVE_ACCOUNT_ALIAS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_3), 
/*      */       
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*  789 */       ADMIN_CREATE_DOMAIN_REQUEST("CREATE_DOMAIN_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  790 */       ADMIN_GET_DOMAIN_REQUEST("GET_DOMAIN_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*      */       
/*  792 */       ADMIN_GET_DOMAIN_INFO_REQUEST("GET_DOMAIN_INFO_REQUEST", TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  793 */       ADMIN_GET_ALL_DOMAINS_REQUEST("GET_ALL_DOMAINS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  794 */       ADMIN_MODIFY_DOMAIN_REQUEST("MODIFY_DOMAIN_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.AUTH_EXPIRED, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*      */       
/*  796 */       ADMIN_DELETE_DOMAIN_REQUEST("DELETE_DOMAIN_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.DOMAIN_NOT_EMPTY, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.DOMAIN_NOT_EMPTY), 
/*  797 */       ADMIN_CREATE_COS_REQUEST("CREATE_COS_REQUEST", TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.PERM_DENIED_2, TestProvDomainStatus.SoapCommands.Result.GOOD), 
/*  798 */       ADMIN_LAST_COMMAND;
/*      */       
/*      */ 
/*      */       private String mFuncName;
/*      */       
/*      */       private TestProvDomainStatus.SoapCommands.Result[][] mExpectedResult;
/*      */       
/*      */ 
/*      */       private Command() {}
/*      */       
/*      */       private Command(String funcName, TestProvDomainStatus.SoapCommands.Result activeUser, TestProvDomainStatus.SoapCommands.Result activeDomainAdmin, TestProvDomainStatus.SoapCommands.Result activeGlobalAdmin, TestProvDomainStatus.SoapCommands.Result suspendedUser, TestProvDomainStatus.SoapCommands.Result suspendedDomainAdmin, TestProvDomainStatus.SoapCommands.Result suspendedGlobalAdmin)
/*      */       {
/*  810 */         this.mFuncName = funcName;
/*  811 */         this.mExpectedResult = new TestProvDomainStatus.SoapCommands.Result[2][TestProvDomainStatus.AccountType.values().length];
/*      */         
/*  813 */         this.mExpectedResult[0][TestProvDomainStatus.AccountType.ACCT_USER.ordinal()] = activeUser;
/*  814 */         this.mExpectedResult[0][TestProvDomainStatus.AccountType.ACCT_DOMAIN_ADMIN.ordinal()] = activeDomainAdmin;
/*  815 */         this.mExpectedResult[0][TestProvDomainStatus.AccountType.ACCT_GLOBAL_ADMIN.ordinal()] = activeGlobalAdmin;
/*  816 */         this.mExpectedResult[1][TestProvDomainStatus.AccountType.ACCT_USER.ordinal()] = suspendedUser;
/*  817 */         this.mExpectedResult[1][TestProvDomainStatus.AccountType.ACCT_DOMAIN_ADMIN.ordinal()] = suspendedDomainAdmin;
/*  818 */         this.mExpectedResult[1][TestProvDomainStatus.AccountType.ACCT_GLOBAL_ADMIN.ordinal()] = suspendedGlobalAdmin;
/*      */       }
/*      */       
/*      */       TestProvDomainStatus.SoapCommands.Result expectedResult(boolean suspended, TestProvDomainStatus.AccountType acctType) {
/*  822 */         int idx = suspended ? 1 : 0;
/*  823 */         return this.mExpectedResult[idx][acctType.ordinal()];
/*      */       }
/*      */     }
/*      */     
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */     public static void run(TestProvDomainStatus.SoapTestContext ctx)
/*      */       throws Exception
/*      */     {
/*  948 */       SoapCommands cmds = new SoapCommands(ctx);
/*      */       
/*  950 */       Class cls = cmds.getClass();
/*  951 */       for (Command c : Command.values())
/*      */       {
/*  953 */         System.out.println((TestProvDomainStatus.SoapTestContext.access$100(ctx) ? "suspended " : "active ") + TestProvDomainStatus.SoapTestContext.access$000(ctx).name() + ": " + c.name());
/*      */         
/*  955 */         if (c.mFuncName != null)
/*      */         {
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*      */ 
/*  963 */           Method method = cls.getMethod(c.mFuncName, new Class[0]);
/*      */           
/*  965 */           Result expectedResult = c.expectedResult(TestProvDomainStatus.SoapTestContext.access$100(ctx), TestProvDomainStatus.SoapTestContext.access$000(ctx));
/*  966 */           Result actualResult = null;
/*      */           try
/*      */           {
/*  969 */             method.invoke(cmds, new Object[0]);
/*  970 */             actualResult = Result.GOOD;
/*      */           } catch (InvocationTargetException e) {
/*  972 */             actualResult = Result.BAD;
/*  973 */             Throwable te = e.getTargetException();
/*  974 */             if ((te instanceof ServiceException)) {
/*  975 */               ServiceException se = (ServiceException)te;
/*  976 */               actualResult = Result.toResult(se);
/*      */             } else {
/*  978 */               te.printStackTrace();
/*      */             }
/*      */           }
/*      */           
/*      */ 
/*  983 */           if (expectedResult != Result.KNOWN_BUG)
/*  984 */             Assert.assertEquals(c.name(), expectedResult, actualResult);
/*      */         }
/*      */       }
/*      */     }
/*      */   }
/*      */   
/*      */   private static class SoapClient extends SoapProvisioning {
/*      */     private void soapAuthenticate(String name, String password) throws ServiceException {
/*  992 */       Element.XMLElement req = new Element.XMLElement(AccountConstants.AUTH_REQUEST);
/*  993 */       Element a = req.addElement("account");
/*  994 */       a.addAttribute("by", "name");
/*  995 */       a.setText(name);
/*  996 */       req.addElement("password").setText(password);
/*  997 */       Element response = invoke(req);
/*  998 */       String authToken = response.getElement("authToken").getText();
/*  999 */       setAuthToken(new ZAuthToken(authToken));
/*      */     }
/*      */     
/*      */     static SoapClient newInstance(Account acct, TestProvDomainStatus.AccountType at) throws Exception
/*      */     {
/* 1004 */       SoapClient soapClient = new SoapClient();
/* 1005 */       if (at == TestProvDomainStatus.AccountType.ACCT_USER)
/*      */       {
/* 1007 */         soapClient.soapSetURI(TestUtil.getAdminSoapUrl());
/*      */         
/* 1009 */         soapClient.soapAuthenticate(acct.getName(), TestProvDomainStatus.PASSWORD);
/*      */       } else {
/* 1011 */         soapClient.soapSetURI(TestUtil.getAdminSoapUrl());
/* 1012 */         soapClient.soapAdminAuthenticate(acct.getName(), TestProvDomainStatus.PASSWORD);
/*      */       }
/*      */       
/* 1015 */       return soapClient;
/*      */     }
/*      */     
/*      */     protected synchronized Element invokeOnTargetAccount(Element request, String targetId) throws ServiceException {
/* 1019 */       return super.invokeOnTargetAccount(request, targetId);
/*      */     }
/*      */   }
/*      */   
/*      */   String[] createTesters(DomainStatus ds, AccountType at) throws Exception {
/* 1024 */     String[] testers = new String[TestProvDomainStatus.SoapCommands.TesterObjs.values().length];
/*      */     
/* 1026 */     String objSuffix = "tester-" + ds.name() + "-" + at.name();
/*      */     
/* 1028 */     String name = ACCOUNT_NAME("acct-" + objSuffix);
/* 1029 */     testers[TestProvDomainStatus.SoapCommands.TesterObjs.TESTER_ID_ACCOUNT_FOR_DELETE_ACCOUNT_REQUEST.ordinal()] = createAccount(name, AccountType.ACCT_USER).getId();
/*      */     
/* 1031 */     return testers;
/*      */   }
/*      */   
/*      */   private void suspendedDomainTest() throws Exception {
/* 1035 */     Domain domain = getDomain();
/* 1036 */     String domainId = domain.getId();
/*      */     
/* 1038 */     Map attrs = new HashMap();
/* 1039 */     attrs.put("zimbraDomainStatus", DomainStatus.active.name());
/* 1040 */     this.mProv.modifyAttrs(domain, attrs);
/*      */     
/*      */ 
/* 1043 */     Account user = createAccount(ACCOUNT_NAME("user"), AccountType.ACCT_USER);
/* 1044 */     String[] testersActiveUser = createTesters(DomainStatus.active, AccountType.ACCT_USER);
/* 1045 */     String[] testersSuspendedUser = createTesters(DomainStatus.suspended, AccountType.ACCT_USER);
/* 1046 */     SoapClient clientUser = SoapClient.newInstance(user, AccountType.ACCT_USER);
/*      */     
/* 1048 */     Account domainAdmin = createAccount(ACCOUNT_NAME("domain-admin"), AccountType.ACCT_DOMAIN_ADMIN);
/* 1049 */     String[] testersActiveDomainAdmin = createTesters(DomainStatus.active, AccountType.ACCT_DOMAIN_ADMIN);
/* 1050 */     String[] testersSuspendedDomainAdmin = createTesters(DomainStatus.suspended, AccountType.ACCT_DOMAIN_ADMIN);
/* 1051 */     SoapClient clientDomainAdmin = SoapClient.newInstance(domainAdmin, AccountType.ACCT_DOMAIN_ADMIN);
/*      */     
/* 1053 */     Account globalAdmin = createAccount(ACCOUNT_NAME("global-admin"), AccountType.ACCT_GLOBAL_ADMIN);
/* 1054 */     String[] testersActiveGlobalAdmin = createTesters(DomainStatus.active, AccountType.ACCT_GLOBAL_ADMIN);
/* 1055 */     String[] testersSuspendedGlobalAdmin = createTesters(DomainStatus.suspended, AccountType.ACCT_GLOBAL_ADMIN);
/* 1056 */     SoapClient clientGlobalAdmin = SoapClient.newInstance(globalAdmin, AccountType.ACCT_GLOBAL_ADMIN);
/*      */     
/* 1058 */     attrs.clear();
/* 1059 */     attrs.put("zimbraDomainStatus", DomainStatus.suspended.name());
/* 1060 */     this.mProv.modifyAttrs(domain, attrs);
/* 1061 */     SoapCommands.run(new SoapTestContext(clientUser, AccountType.ACCT_USER, user, true, this.DOMAIN_NAME, domainId, testersSuspendedUser, this.TEST_ID));
/* 1062 */     SoapCommands.run(new SoapTestContext(clientDomainAdmin, AccountType.ACCT_DOMAIN_ADMIN, user, true, this.DOMAIN_NAME, domainId, testersSuspendedDomainAdmin, this.TEST_ID));
/* 1063 */     SoapCommands.run(new SoapTestContext(clientGlobalAdmin, AccountType.ACCT_GLOBAL_ADMIN, user, true, this.DOMAIN_NAME, domainId, testersSuspendedGlobalAdmin, this.TEST_ID));
/*      */     
/* 1065 */     attrs.clear();
/* 1066 */     attrs.put("zimbraDomainStatus", DomainStatus.active.name());
/* 1067 */     this.mProv.modifyAttrs(domain, attrs);
/* 1068 */     SoapCommands.run(new SoapTestContext(clientUser, AccountType.ACCT_USER, user, false, this.DOMAIN_NAME, domainId, testersActiveUser, this.TEST_ID));
/* 1069 */     SoapCommands.run(new SoapTestContext(clientDomainAdmin, AccountType.ACCT_DOMAIN_ADMIN, user, false, this.DOMAIN_NAME, domainId, testersActiveDomainAdmin, this.TEST_ID));
/* 1070 */     SoapCommands.run(new SoapTestContext(clientGlobalAdmin, AccountType.ACCT_GLOBAL_ADMIN, user, false, this.DOMAIN_NAME, domainId, testersActiveGlobalAdmin, this.TEST_ID));
/*      */   }
/*      */   
/*      */   private void execute() throws Exception
/*      */   {
/* 1075 */     suspendedDomainTest();
/*      */   }
/*      */   
/*      */   @Test
/*      */   public void testDomainStatus() throws Exception {
/*      */     try {
/* 1081 */       System.out.println("\nTest " + this.TEST_ID + " starting\n");
/* 1082 */       execute();
/* 1083 */       System.out.println("\nTest " + this.TEST_ID + " done!");
/*      */     } catch (ServiceException e) {
/* 1085 */       Throwable cause = e.getCause();
/* 1086 */       System.out.println("ERROR: " + e.getCode() + " (" + e.getMessage() + ")" + (cause == null ? "" : new StringBuilder().append(" (cause: ").append(cause.getClass().getName()).append(" ").append(cause.getMessage()).append(")").toString()));
/*      */       
/* 1088 */       e.printStackTrace(System.out);
/* 1089 */       System.out.println("\nTest " + this.TEST_ID + " failed!");
/*      */     }
/*      */   }
/*      */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/qa/unittest/TestProvDomainStatus.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */